package org.lightweightimageviewer.liv;

import java.io.File;
import java.io.FilenameFilter;
/**
 * This filter is used to list directory contents of valid images.
 * @author Steven Boscarine
 *
 */
public class ImageFilter implements FilenameFilter {
	private ImageFilter(){}
	@Override
    public boolean accept(File dir, String name) {
        return (name.endsWith(".jpg") || name.endsWith(".gif") || name.endsWith(".png"));
    }
    
    private static final ImageFilter instance = new ImageFilter();
    protected static final ImageFilter getInstance(){
    	return instance;
    }
}